﻿using System;
using System.Runtime.InteropServices;
using System.Text;

namespace XimalayaAudioDownloader
{
	// Token: 0x02000009 RID: 9
	internal class ReadSetting
	{
		// Token: 0x06000075 RID: 117 RVA: 0x00006461 File Offset: 0x00004661
		public ReadSetting()
		{
			this.Path = AppDomain.CurrentDomain.BaseDirectory + "Settings.aps";
		}

		// Token: 0x06000076 RID: 118
		[DllImport("kernel32")]
		private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);

		// Token: 0x06000077 RID: 119
		[DllImport("kernel32")]
		private static extern int GetPrivateProfileString(string section, string key, string defVal, StringBuilder retVal, int size, string filePath);

		// Token: 0x06000078 RID: 120
		[DllImport("kernel32")]
		private static extern int GetPrivateProfileString(string section, string key, string defVal, byte[] retVal, int size, string filePath);

		// Token: 0x06000079 RID: 121 RVA: 0x00006485 File Offset: 0x00004685
		public void IniWriteValue(string section, string key, string iValue)
		{
			ReadSetting.WritePrivateProfileString(section, key, iValue, this.Path);
		}

		// Token: 0x0600007A RID: 122 RVA: 0x00006498 File Offset: 0x00004698
		public string IniReadValue(string section, string key)
		{
			StringBuilder stringBuilder = new StringBuilder(255);
			int privateProfileString = ReadSetting.GetPrivateProfileString(section, key, "", stringBuilder, 255, this.Path);
			return stringBuilder.ToString();
		}

		// Token: 0x0600007B RID: 123 RVA: 0x000064D4 File Offset: 0x000046D4
		public byte[] IniReadValues(string section, string key)
		{
			byte[] array = new byte[255];
			int privateProfileString = ReadSetting.GetPrivateProfileString(section, key, "", array, 255, this.Path);
			return array;
		}

		// Token: 0x0400004B RID: 75
		public string Path;
	}
}
